Access attribute via link?

Hi!

How can I access attributes via a link? I have following situation:

for lnk_InnerOutLink2 in gobj_CurrentObject2 -> "*" do

{

if(lnk_InnerOutLink2."c_This_is_a""" == "functional_requirements" && lnk_InnerOutLink2."c_Compliance""" == "yes")

{

}

}

 

I hope you can answer my question: Delivers the if statement lnk_InnerOutLink2."c_This_is_a""" == ... the correct attribute-value of the attribute of the object in a another module which the link "lnk_InnerOutLink2" points to???

 

Thx!


bandchef - Fri Nov 15 04:12:59 EST 2013

Re: Access attribute via link?
adevicq - Fri Nov 15 04:24:32 EST 2013

Hi,

You get the target objet via the "target" function:

Object o = target(l)

o will be null if the target module is closed. You may have to open it prior to access the object.

To open the target module use:

 

Module loadModuleFromLink(Link l) {    
ModuleVersion otherVersion = null 
ModName_ otherMod = null 
Module m = null 
otherVersion = targetVersion l 
otherMod = module(otherVersion) 
if (null otherMod || isDeleted otherMod)    return null    
noError   
m = read(fullName(otherMod), true)    
return m 
}

 

regards,

alain

 

Re: Access attribute via link?
GregM_dxler - Fri Nov 15 08:41:51 EST 2013

By the way, it would be nice if you didn't use such small font in your posts.